html,body {
    margin: 0;
    padding: 0;
}
.parent {
    display: flex;
    flex: 1;
    height: 300px;
    justify-content: center;
    align-items: center;
    background-color: antiquewhite;
}
.child {
    width: 100px;
    height: 100px;
    background-color: #000;
}